package com.yanqu.road.server.cmd.union.cross;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.rank.RankProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.rank.CrossRankMgr;
import com.yanqu.road.server.manager.union.CrossUnionRankMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_CROSS_UNION_GROUP_RANK_WORSHIP, desc = "分组榜单膜拜")
public class CrossServerGroupRankWorshipCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        RankProto.CrossGroupWorshipReqMsg req = RankProto.CrossGroupWorshipReqMsg.parseFrom(packet.getBytes());
        RankProto.CrossGroupWorshipRespMsg.Builder respMsg = CrossUnionRankMgr.rankWorship(req);
        YanQuMessage message = YanQuMessageUtils.buildMessage(Protocol.S_CROSS_GROUP_WORSHIP, respMsg);
        MessageHelper.sendPacket(serverId, packet.getPlayerId(), message);
    }

    @Override
    public void sendData() {

    }
}
